<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="xm"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/base.css">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/orderList.css">
<script type="text/javascript">

function deleteOrder(orderId){
	if(confirm("您是否确认删除订单")){
		location.href='<%=request.getContextPath()%>/filter/orders?m=deleteOrder&orderId='+orderId;
	}
}
function ordersList(orderId,cartId){
	location.href='<%=request.getContextPath()%>/filter/orders?m=ordersListAndDetail&orderId='+orderId+'&cartId='+cartId;
}
</script>
</head>
<body>
	 <div id="box">
		 <jsp:include page="/comm/header.jsp"></jsp:include>
		 <div id="main">
		 	 <div id="orderListInfo">
		 	 	 <img alt="" src="<%=request.getContextPath() %>/images/Car_icon_19.png">
		 	 	 <table>
		 	 	 	 <tr class="bg_tr">
		 	 	 	 	 <th>订单编号</th>
		 	 	 	 	 <th>金额</th>
		 	 	 	 	 <th>下单日期</th>
		 	 	 	 	 <th>订单状态</th>
		 	 	 	 	 <th>编辑</th>
		 	 	 	 </tr>
		 	 	 	 <xm:forEach items="${ordersList }" var="order">
	                <tr>
	                   <td>${order.orderNO }</td>
	                   <td class="font_red">￥${order.money }</td>
	                   <td>${order.orderDate }</td>
	                   <td>
	                       <xm:if test="${order.orderStatus eq 1 }">	                       
	                                                                                 已下单，未处理
	                       </xm:if>
	                       <xm:if test="${order.orderStatus eq 2 }">	                       
	                                                                                 已处理，未发货
	                       </xm:if>
	                       <xm:if test="${order.orderStatus eq 3 }">	                       
	                                                                                订单完成
	                       </xm:if>
	                   </td>
	                   <td>
	                       <a class="font_red" href="javascript:ordersList(${order.id },${order.cart })">查看订单</a>
	                       <a href="javascript:deleteOrder(${order.id })">删除订单</a>
	                   </td>
	                </tr>
                </xm:forEach>
	 	       	</table>
		 	 </div>
		 </div>
		 <jsp:include page="/comm/footer.jsp"></jsp:include>
	 </div>
</body>
</html>